package com.tengju.bff.interfaces.app.csa;

import com.tengju.bff.interfaces.app.csa.facade.GenSecCustomerServiceInfoFacade;
import com.tengju.bff.interfaces.app.csa.vo.GenSecCustomerServiceInfoVO;
import com.tengju.bff.interfaces.shared.ApiResponse;
import com.tengju.bff.interfaces.shared.InterfaceException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Validated
@RestController
@Api(tags = "俱乐部客服信息")
@RequestMapping(value = "app/csa/")
@Slf4j
public class GenSecCustomerServiceInfoController {

    @Autowired
    private GenSecCustomerServiceInfoFacade genSecCustomerServiceInfoFacade;

    @ApiOperation(value = "俱乐部客服信息",notes = "俱乐部客服信息")
    @RequestMapping(value = "getClubCustomerServiceInfo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ApiResponse<GenSecCustomerServiceInfoVO> getCsaInfo() {
        try {
            return ApiResponse.newSuccess(genSecCustomerServiceInfoFacade.getClubCustomerServiceInfo());
        } catch (InterfaceException e) {
            log.error("查询异常：",e);
            return ApiResponse.newFailure(e.getCode(),e.getMsg());
        }

    }


}
